<template>
  <div
    class="borderType"
    :style="{ width: widthAuto ? '100%' : 'fit-content;' }"
  >
    <span class="border row1"></span>
    <span class="border row2"></span>
    <span class="border col1"></span>
    <span class="border col2"></span>
    <div v-if="title" class="borderType_title">{{ title }}</div>
    <div class="borderType_content">
      <slot></slot>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    title: [String],
    widthAuto: Boolean
  },
  data() {
    return {};
  }
};
</script>
<style scoped>
.borderType {
  position: relative;
  width: fit-content;
  height: auto;
  border: 1px solid #0063ba;
  background: rgba(4, 89, 168, 0.7);
  padding: 10px 10px;
}
.border {
  position: absolute;
  padding: 5px;
  border-style: solid;
  border-color: #2bccff;
}
.row1 {
  border-width: 4px 0 0 4px;
  top: -3px;
  left: -3px;
}
.row2 {
  border-width: 4px 4px 0 0;
  top: -3px;
  right: -3px;
}
.col1 {
  border-width: 0 0 4px 4px;
  bottom: -3px;
  left: -3px;
}
.col2 {
  border-width: 0 4px 4px 0;
  bottom: -3px;
  right: -3px;
}
.borderType_title {
  height: 20px;
  line-height: 20px;
  font-size: 18px;
  color: #afdaf1;
}
.borderType_content {
  width: 100%;
  height: auto;
}
</style>
